.class public Lcom/instagram/android/explore/widget/a;
.super Landroid/widget/FrameLayout;
.source "PhotoLayoutSwitcher.java"


# instance fields
.field private a:I

.field private b:I

.field private c:I

.field private d:I

.field private e:Z

.field private f:Z


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 0
    .parameter

    .prologue
    .line 44
    invoke-direct {p0, p1}, Landroid/widget/FrameLayout;-><init>(Landroid/content/Context;)V

    .line 45
    invoke-direct {p0}, Lcom/instagram/android/explore/widget/a;->a()V

    .line 46
    return-void
.end method

.method private a()V
    .locals 4

    .prologue
    .line 59
    invoke-virtual {p0}, Lcom/instagram/android/explore/widget/a;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    sget v1, Lcom/facebook/au;->explore_people_spacing_photo_grid:I

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getDimension(I)F

    move-result v0

    float-to-int v0, v0

    iput v0, p0, Lcom/instagram/android/explore/widget/a;->a:I

    .line 61
    const/4 v0, 0x0

    :goto_0
    const/4 v1, 0x6

    if-ge v0, v1, :cond_0

    .line 62
    invoke-virtual {p0}, Lcom/instagram/android/explore/widget/a;->generateDefaultLayoutParams()Landroid/widget/FrameLayout$LayoutParams;

    move-result-object v1

    .line 63
    const/16 v2, 0x33

    iput v2, v1, Landroid/widget/FrameLayout$LayoutParams;->gravity:I

    .line 64
    new-instance v2, Lcom/instagram/android/mediacache/IgImageView;

    invoke-virtual {p0}, Lcom/instagram/android/explore/widget/a;->getContext()Landroid/content/Context;

    move-result-object v3

    invoke-direct {v2, v3}, Lcom/instagram/android/mediacache/IgImageView;-><init>(Landroid/content/Context;)V

    invoke-virtual {p0, v2, v1}, Lcom/instagram/android/explore/widget/a;->addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V

    .line 61
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 66
    :cond_0
    return-void
.end method

.method private a(I)V
    .locals 4
    .parameter

    .prologue
    const/high16 v3, 0x4000

    .line 113
    invoke-virtual {p0, p1}, Lcom/instagram/android/explore/widget/a;->getChildAt(I)Landroid/view/View;

    move-result-object v0

    iget v1, p0, Lcom/instagram/android/explore/widget/a;->d:I

    invoke-static {v1, v3}, Landroid/view/View$MeasureSpec;->makeMeasureSpec(II)I

    move-result v1

    iget v2, p0, Lcom/instagram/android/explore/widget/a;->d:I

    invoke-static {v2, v3}, Landroid/view/View$MeasureSpec;->makeMeasureSpec(II)I

    move-result v2

    invoke-virtual {v0, v1, v2}, Landroid/view/View;->measure(II)V

    .line 117
    return-void
.end method

.method private b()V
    .locals 10

    .prologue
    const/4 v9, 0x4

    const/4 v8, 0x3

    const/4 v7, 0x2

    const/4 v6, 0x1

    const/4 v3, 0x0

    .line 128
    const/4 v0, 0x6

    new-array v1, v0, [I

    aput v3, v1, v3

    aput v3, v1, v6

    iget v0, p0, Lcom/instagram/android/explore/widget/a;->c:I

    iget v2, p0, Lcom/instagram/android/explore/widget/a;->a:I

    add-int/2addr v0, v2

    aput v0, v1, v7

    iget v0, p0, Lcom/instagram/android/explore/widget/a;->d:I

    iget v2, p0, Lcom/instagram/android/explore/widget/a;->a:I

    add-int/2addr v0, v2

    aput v0, v1, v8

    iget v0, p0, Lcom/instagram/android/explore/widget/a;->d:I

    iget v2, p0, Lcom/instagram/android/explore/widget/a;->a:I

    add-int/2addr v0, v2

    aput v0, v1, v9

    const/4 v0, 0x5

    iget v2, p0, Lcom/instagram/android/explore/widget/a;->d:I

    iget v4, p0, Lcom/instagram/android/explore/widget/a;->a:I

    add-int/2addr v2, v4

    aput v2, v1, v0

    .line 137
    const/4 v0, 0x6

    new-array v0, v0, [I

    iget v2, p0, Lcom/instagram/android/explore/widget/a;->c:I

    iget v4, p0, Lcom/instagram/android/explore/widget/a;->a:I

    add-int/2addr v2, v4

    aput v2, v0, v3

    aput v3, v0, v6

    aput v3, v0, v7

    aput v3, v0, v8

    iget v2, p0, Lcom/instagram/android/explore/widget/a;->c:I

    iget v4, p0, Lcom/instagram/android/explore/widget/a;->a:I

    add-int/2addr v2, v4

    aput v2, v0, v9

    const/4 v2, 0x5

    iget v4, p0, Lcom/instagram/android/explore/widget/a;->d:I

    iget v5, p0, Lcom/instagram/android/explore/widget/a;->a:I

    add-int/2addr v4, v5

    aput v4, v0, v2

    .line 146
    iget v2, p0, Lcom/instagram/android/explore/widget/a;->b:I

    if-ne v2, v6, :cond_0

    .line 147
    const/4 v0, 0x6

    new-array v1, v0, [I

    aput v3, v1, v3

    aput v3, v1, v6

    aput v3, v1, v7

    iget v0, p0, Lcom/instagram/android/explore/widget/a;->c:I

    iget v2, p0, Lcom/instagram/android/explore/widget/a;->a:I

    add-int/2addr v0, v2

    aput v0, v1, v8

    iget v0, p0, Lcom/instagram/android/explore/widget/a;->c:I

    iget v2, p0, Lcom/instagram/android/explore/widget/a;->a:I

    add-int/2addr v0, v2

    aput v0, v1, v9

    const/4 v0, 0x5

    iget v2, p0, Lcom/instagram/android/explore/widget/a;->c:I

    iget v4, p0, Lcom/instagram/android/explore/widget/a;->a:I

    add-int/2addr v2, v4

    aput v2, v1, v0

    .line 155
    const/4 v0, 0x6

    new-array v0, v0, [I

    aput v3, v0, v3

    iget v2, p0, Lcom/instagram/android/explore/widget/a;->c:I

    iget v4, p0, Lcom/instagram/android/explore/widget/a;->a:I

    add-int/2addr v2, v4

    aput v2, v0, v6

    iget v2, p0, Lcom/instagram/android/explore/widget/a;->d:I

    iget v4, p0, Lcom/instagram/android/explore/widget/a;->a:I

    add-int/2addr v2, v4

    aput v2, v0, v7

    aput v3, v0, v8

    iget v2, p0, Lcom/instagram/android/explore/widget/a;->c:I

    iget v4, p0, Lcom/instagram/android/explore/widget/a;->a:I

    add-int/2addr v2, v4

    aput v2, v0, v9

    const/4 v2, 0x5

    iget v4, p0, Lcom/instagram/android/explore/widget/a;->d:I

    iget v5, p0, Lcom/instagram/android/explore/widget/a;->a:I

    add-int/2addr v4, v5

    aput v4, v0, v2

    move-object v2, v1

    move-object v1, v0

    .line 186
    :goto_0
    invoke-virtual {p0}, Lcom/instagram/android/explore/widget/a;->getChildCount()I

    move-result v0

    if-ge v3, v0, :cond_2

    .line 187
    invoke-direct {p0, v3}, Lcom/instagram/android/explore/widget/a;->c(I)Lcom/instagram/android/mediacache/IgImageView;

    move-result-object v4

    .line 188
    invoke-virtual {v4}, Lcom/instagram/android/mediacache/IgImageView;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;

    move-result-object v0

    check-cast v0, Landroid/view/ViewGroup$MarginLayoutParams;

    .line 189
    aget v5, v2, v3

    iput v5, v0, Landroid/view/ViewGroup$MarginLayoutParams;->topMargin:I

    .line 190
    aget v5, v1, v3

    iput v5, v0, Landroid/view/ViewGroup$MarginLayoutParams;->leftMargin:I

    .line 191
    invoke-virtual {v4, v0}, Lcom/instagram/android/mediacache/IgImageView;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    .line 186
    add-int/lit8 v0, v3, 0x1

    move v3, v0

    goto :goto_0

    .line 166
    :cond_0
    iget-boolean v2, p0, Lcom/instagram/android/explore/widget/a;->e:Z

    if-eqz v2, :cond_1

    .line 167
    iget v2, p0, Lcom/instagram/android/explore/widget/a;->d:I

    iget v4, p0, Lcom/instagram/android/explore/widget/a;->a:I

    add-int/2addr v2, v4

    aput v2, v0, v6

    .line 168
    aget v2, v0, v6

    aput v2, v0, v7

    .line 169
    aput v3, v0, v3

    .line 173
    :cond_1
    iget-boolean v2, p0, Lcom/instagram/android/explore/widget/a;->f:Z

    if-eqz v2, :cond_3

    .line 174
    const/4 v1, 0x6

    new-array v1, v1, [I

    iget v2, p0, Lcom/instagram/android/explore/widget/a;->c:I

    iget v4, p0, Lcom/instagram/android/explore/widget/a;->a:I

    add-int/2addr v2, v4

    aput v2, v1, v3

    iget v2, p0, Lcom/instagram/android/explore/widget/a;->c:I

    iget v4, p0, Lcom/instagram/android/explore/widget/a;->a:I

    add-int/2addr v2, v4

    aput v2, v1, v6

    iget v2, p0, Lcom/instagram/android/explore/widget/a;->d:I

    iget v4, p0, Lcom/instagram/android/explore/widget/a;->a:I

    add-int/2addr v2, v4

    aput v2, v1, v7

    aput v3, v1, v8

    aput v3, v1, v9

    const/4 v2, 0x5

    aput v3, v1, v2

    move-object v2, v1

    move-object v1, v0

    goto :goto_0

    .line 193
    :cond_2
    return-void

    :cond_3
    move-object v2, v1

    move-object v1, v0

    goto :goto_0
.end method

.method private b(I)V
    .locals 4
    .parameter

    .prologue
    const/high16 v3, 0x4000

    .line 120
    invoke-virtual {p0, p1}, Lcom/instagram/android/explore/widget/a;->getChildAt(I)Landroid/view/View;

    move-result-object v0

    iget v1, p0, Lcom/instagram/android/explore/widget/a;->c:I

    invoke-static {v1, v3}, Landroid/view/View$MeasureSpec;->makeMeasureSpec(II)I

    move-result v1

    iget v2, p0, Lcom/instagram/android/explore/widget/a;->c:I

    invoke-static {v2, v3}, Landroid/view/View$MeasureSpec;->makeMeasureSpec(II)I

    move-result v2

    invoke-virtual {v0, v1, v2}, Landroid/view/View;->measure(II)V

    .line 124
    return-void
.end method

.method private c(I)Lcom/instagram/android/mediacache/IgImageView;
    .locals 1
    .parameter

    .prologue
    .line 209
    invoke-virtual {p0, p1}, Lcom/instagram/android/explore/widget/a;->getChildAt(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Lcom/instagram/android/mediacache/IgImageView;

    return-object v0
.end method


# virtual methods
.method public a(ZZ)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 196
    iput-boolean p1, p0, Lcom/instagram/android/explore/widget/a;->e:Z

    .line 197
    iput-boolean p2, p0, Lcom/instagram/android/explore/widget/a;->f:Z

    .line 198
    return-void
.end method

.method protected onMeasure(II)V
    .locals 5
    .parameter "widthMeasureSpec"
    .parameter "heightMeasureSpec"

    .prologue
    const/4 v2, 0x1

    const/4 v4, 0x0

    .line 81
    invoke-static {p1}, Landroid/view/View$MeasureSpec;->getSize(I)I

    move-result v1

    .line 85
    iget v0, p0, Lcom/instagram/android/explore/widget/a;->a:I

    mul-int/lit8 v0, v0, 0x2

    sub-int v0, v1, v0

    div-int/lit8 v0, v0, 0x3

    iput v0, p0, Lcom/instagram/android/explore/widget/a;->c:I

    .line 88
    iget v0, p0, Lcom/instagram/android/explore/widget/a;->c:I

    mul-int/lit8 v0, v0, 0x2

    iget v3, p0, Lcom/instagram/android/explore/widget/a;->a:I

    add-int/2addr v0, v3

    iput v0, p0, Lcom/instagram/android/explore/widget/a;->d:I

    .line 90
    invoke-virtual {p0}, Lcom/instagram/android/explore/widget/a;->getParent()Landroid/view/ViewParent;

    move-result-object v0

    check-cast v0, Lcom/instagram/android/explore/widget/SnapToGridListView;

    invoke-virtual {v0}, Lcom/instagram/android/explore/widget/SnapToGridListView;->getRowCount()I

    move-result v0

    iput v0, p0, Lcom/instagram/android/explore/widget/a;->b:I

    .line 92
    iget v0, p0, Lcom/instagram/android/explore/widget/a;->b:I

    if-ne v0, v2, :cond_0

    .line 95
    invoke-direct {p0, v4}, Lcom/instagram/android/explore/widget/a;->b(I)V

    .line 98
    iget v0, p0, Lcom/instagram/android/explore/widget/a;->d:I

    .line 103
    :goto_0
    invoke-virtual {p0}, Lcom/instagram/android/explore/widget/a;->getChildCount()I

    move-result v3

    if-ge v2, v3, :cond_1

    .line 104
    invoke-direct {p0, v2}, Lcom/instagram/android/explore/widget/a;->b(I)V

    .line 103
    add-int/lit8 v2, v2, 0x1

    goto :goto_0

    .line 100
    :cond_0
    invoke-direct {p0, v4}, Lcom/instagram/android/explore/widget/a;->a(I)V

    move v0, v1

    goto :goto_0

    .line 107
    :cond_1
    invoke-virtual {p0, v1, v0}, Lcom/instagram/android/explore/widget/a;->setMeasuredDimension(II)V

    .line 109
    invoke-direct {p0}, Lcom/instagram/android/explore/widget/a;->b()V

    .line 110
    return-void
.end method

.method public setPhotoUrls([Ljava/lang/String;)V
    .locals 3
    .parameter "urls"

    .prologue
    .line 202
    const/4 v0, 0x0

    :goto_0
    invoke-virtual {p0}, Lcom/instagram/android/explore/widget/a;->getChildCount()I

    move-result v1

    if-ge v0, v1, :cond_0

    .line 203
    invoke-direct {p0, v0}, Lcom/instagram/android/explore/widget/a;->c(I)Lcom/instagram/android/mediacache/IgImageView;

    move-result-object v1

    const/4 v2, 0x0

    invoke-virtual {v1, v2}, Lcom/instagram/android/mediacache/IgImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    .line 204
    invoke-direct {p0, v0}, Lcom/instagram/android/explore/widget/a;->c(I)Lcom/instagram/android/mediacache/IgImageView;

    move-result-object v1

    aget-object v2, p1, v0

    invoke-virtual {v1, v2}, Lcom/instagram/android/mediacache/IgImageView;->setUrl(Ljava/lang/String;)V

    .line 202
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 206
    :cond_0
    return-void
.end method
